import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Cookie from "js-cookie";
Vue.use(VueRouter);
const routes = Cookie.get('site_lang') == 'en-US' ? [
    {
        path: "/",
        redirect: "/home"
    },
    {
        path: "/home",//首页
        name: "Home",
        component: Home,
        meta: {
            title: 'Achievement Statistics'
        }
    },
    {
        path: "/addPage",//合同成果新建页
        name: "addPage",
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import("@/views/addPage.vue"),
        meta: {
            title: 'New Statistics Table'
        }
    },
    {
        path: "/succeed",//新建成功页
        name: "succeed",
        component: () =>
            import("@/views/succeed.vue"),
        meta: {
            title: 'New Statistics Table'
        }
    },
    {
        path: "/audit",//审核页面
        name: "audit",
        component: () =>
            import("@/views/audit.vue"),
        meta: {
            title: 'Apply for Approval'
        }
    },
    // 合同类
    {
        path: "/contractSecond",//合同新建第二页
        name: "contractSecond",
        component: () =>
            import("@/views/contract/contractSecond.vue"),
        meta: {
            title: 'New Statistics Table'
        }
    },
    {
        path: "/contractThirdly",//合同新建第三页
        name: "contractThirdly",
        component: () =>
            import("@/views/contract/contractThirdly.vue"),
        meta: {
            title: 'New Statistics Table'
        }
    },
    {
        path: "/contractDetail",//合同详情页
        name: "contractDetail",
        component: () =>
            import("@/views/contract/contractDetail.vue"),
        meta: {
            title: 'Achievement Statistics System'
        }
    },
    {
        path: "/contractTrace",//合同追踪页
        name: "contractTrace",
        component: () =>
            import("@/views/contract/contractTrace.vue"),
        meta: {
            title: 'Tracking Feedback'
        }
    },
    {
        path: "/conTraceDetail",//合同追踪详情页
        name: "conTraceDetail",
        component: () =>
            import("@/views/contract/conTraceDetail.vue"),
        meta: {
            title: 'Tracking Details'
        }
    },
    // 成果类
    {
        path: "/achievementsSecond",//成果新建第二页
        name: "achievementsSecond",
        component: () =>
            import("@/views/achievements/achievementsSecond.vue"),
        meta: {
            title: 'New Statistics Table'
        }
    },
    {
        path: "/achievementsThirdly",//成果新建第三页
        name: "achievementsThirdly",
        component: () =>
            import("@/views/achievements/achievementsThirdly.vue"),
        meta: {
            title: 'New Statistics Table'
        }
    },
    {
        path: "/achievementsDetail",//成果详情页
        name: "achievementsDetail",
        component: () =>
            import("@/views/achievements/achievementsDetail.vue"),
        meta: {
            title: 'Achievement Statistics System'
        }
    },
    {
        path: "/achievementsTrace",//成果追踪页
        name: "achievementsTrace",
        component: () =>
            import("@/views/achievements/achievementsTrace.vue"),
        meta: {
            title: 'Tracking Feedback'
        }
    },
    {
        path: "/achTraceDetail",//成果追踪详情页
        name: "achTraceDetail",
        component: () =>
            import("@/views/achievements/achTraceDetail.vue"),
        meta: {
            title: 'Tracking Details'
        }
    },
    {
        path: "/stayTuned",//敬请期待
        name: "StayTuned",
        component: () =>
            import("@/views/StayTuned.vue"),
        meta: {
            title: 'Achievement Statistics'
        }
    }
] : [
        {
            path: "/",
            redirect: "/home"
        },
        {
            path: "/home",//首页
            name: "Home",
            component: Home,
            meta: {
                title: '成果统计系统'
            }
        },
        {
            path: "/addPage",//合同成果新建页
            name: "addPage",
            // route level code-splitting
            // this generates a separate chunk (about.[hash].js) for this route
            // which is lazy-loaded when the route is visited.
            component: () =>
                import("@/views/addPage.vue"),
            meta: {
                title: '新建统计表'
            }
        },
        {
            path: "/succeed",//新建成功页
            name: "succeed",
            component: () =>
                import("@/views/succeed.vue"),
            meta: {
                title: '新建统计表'
            }
        },
        {
            path: "/audit",//审核页面
            name: "audit",
            component: () =>
                import("@/views/audit.vue"),
            meta: {
                title: '申报审核'
            }
        },
        // 合同类
        {
            path: "/contractSecond",//合同新建第二页
            name: "contractSecond",
            component: () =>
                import("@/views/contract/contractSecond.vue"),
            meta: {
                title: '新建统计表'
            }
        },
        {
            path: "/contractThirdly",//合同新建第三页
            name: "contractThirdly",
            component: () =>
                import("@/views/contract/contractThirdly.vue"),
            meta: {
                title: '新建统计表'
            }
        },
        {
            path: "/contractDetail",//合同详情页
            name: "contractDetail",
            component: () =>
                import("@/views/contract/contractDetail.vue"),
            meta: {
                title: '成果统计系统'
            }
        },
        {
            path: "/contractTrace",//合同追踪页
            name: "contractTrace",
            component: () =>
                import("@/views/contract/contractTrace.vue"),
            meta: {
                title: '追踪反馈'
            }
        }, {
            path: "/conTraceDetail",//合同追踪详情页
            name: "conTraceDetail",
            component: () =>
                import("@/views/contract/conTraceDetail.vue"),
            meta: {
                title: '追踪详情'
            }
        },
        // 成果类
        {
            path: "/achievementsSecond",//成果新建第二页
            name: "achievementsSecond",
            component: () =>
                import("@/views/achievements/achievementsSecond.vue"),
            meta: {
                title: '新建统计表'
            }
        },
        {
            path: "/achievementsThirdly",//成果新建第三页
            name: "achievementsThirdly",
            component: () =>
                import("@/views/achievements/achievementsThirdly.vue"),
            meta: {
                title: '新建统计表'
            }
        },
        {
            path: "/achievementsDetail",//成果详情页
            name: "achievementsDetail",
            component: () =>
                import("@/views/achievements/achievementsDetail.vue"),
            meta: {
                title: '成果统计系统'
            }
        },
        {
            path: "/achievementsTrace",//成果追踪页
            name: "achievementsTrace",
            component: () =>
                import("@/views/achievements/achievementsTrace.vue"),
            meta: {
                title: '追踪反馈'
            }
        },
        {
            path: "/achTraceDetail",//成果追踪详情页
            name: "achTraceDetail",
            component: () =>
                import("@/views/achievements/achTraceDetail.vue"),
            meta: {
                title: '追踪详情'
            }
        },
        {
            path: "/stayTuned",//敬请期待
            name: "StayTuned",
            component: () =>
                import("@/views/StayTuned.vue"),
            meta: {
                title: '成果统计系统'
            }
        }
    ];

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
});

export default router;
